home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
magazine
/
aijournl
/
1986_09
/
aiapp3.ltg
< prev
next >
Wrap
Text File
|
1986-10-30
|
500b
|
20 lines
Listing 3
Solve procedure using unification
PROCEDURE solve(query,env,level) ;
VAR
i : integer ;
new_env : same as query and env ;
BEGIN
IF query = NIL
THEN print_env(env)
ELSE
FOR i := 1 TO max_rule_no DO
IF unify(copy(head(rule[i]),level+1),head(query),env,new_env)
THEN solve(append(copy(tail(rule[i]),level+1),tail(query),
new_env,level+1) ;
END ; (* solve *)